﻿<Window x:Class="AlertWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Co9320="clr-namespace:Co9320"
    Title=""  ShowInTaskbar="False"
    Width="290" Height="150"  WindowStyle="None"  
    ShowActivated="False" Visibility="Collapsed"
    Background="Transparent"        
    Topmost="True" AllowsTransparency="True" ResizeMode="NoResize">
    
    <!--<Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" SpreadMethod="Pad">
            <GradientStop Color="#FFBDD0E5" Offset="0.107"/>
            <GradientStop Color="#FF82AFDF" Offset="1"/>
            <GradientStop Color="#FF99B4D1" Offset="0.679"/>
        </LinearGradientBrush>
    </Window.Background>-->

    <!--<Window.DataContext>
        <Co9320:NamaAlertDataContext />
    </Window.DataContext>-->

    <Window.Resources>
        <Image x:Key="NoImage" Source="../noimage.jpg" />
        <ControlTemplate x:Key="CloseButtonTemplate" TargetType="{x:Type Button}">
            <Grid Background="Transparent">
                <Viewbox>
                    <ContentPresenter/>
                </Viewbox>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="BitmapEffect">
                        <Setter.Value>
                            <OuterGlowBitmapEffect GlowSize="12" GlowColor="White"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="BitmapEffect">
                        <Setter.Value>
                            <OuterGlowBitmapEffect GlowSize="12" GlowColor="DarkGray"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Window.Resources>


    <Border MouseDown="Window_MouseDown"  BorderBrush="Black"  Width="280" Height="140" HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="1" CornerRadius="5" Background="#3BB2EA">
        <Border.BitmapEffect>
            <DropShadowBitmapEffect Softness=".3" ShadowDepth="3" Color="Gray"/>
        </Border.BitmapEffect>

        <Border BorderBrush="#A0A0A0" BorderThickness="1" CornerRadius="5">
            <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5">
                    <!--<GradientStop Color="#3BB2EA" Offset="0" />
                    <GradientStop Color="#EFF7FA" Offset="0.3" />-->
                    <GradientStop Color="#B6CADF" Offset="0" />
                    <GradientStop Color="#E8F0FF" Offset="0.3" />
                </LinearGradientBrush>
            </Border.Background>

            <!--<DockPanel Background="#EFF7FA">
                <Border Height="100"  DockPanel.Dock="Top">
                    <Border Name="WindowButtonsPlaceholder" HorizontalAlignment="Right" VerticalAlignment="Top"
                             Margin="0,-1,10,0" />
                </Border>
                <Thumb  HorizontalAlignment="Right" DockPanel.Dock="Bottom"
                       Cursor="SizeNWSE" />
                <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Essential Window</TextBlock>
            </DockPanel>-->
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="24" />
                    <RowDefinition />
                    <!--<RowDefinition Height="24" />-->
                </Grid.RowDefinitions>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="23" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0">
                        <!--<Image Margin="5 0 0 0" Grid.Column="1" HorizontalAlignment="Right" Source="../Icons/notify.ico" Stretch="None" Width="16" Height="16" />-->
                        <TextBlock Margin="5 0 0 0" Cursor="Hand" MouseLeftButtonDown="OpenUri"
                    Text="{Binding Path=Title}" VerticalAlignment="Center">
                    <TextBlock.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="URLをコピー" Click="MenuItem_Click"  />
                        </ContextMenu>
                    </TextBlock.ContextMenu>
                        </TextBlock>
                    </StackPanel>
                    <Button Click="CloseButton_Click" Margin="0 0 2 0"
                                                  Grid.Column="1"
                                                  HorizontalAlignment="Right" VerticalAlignment="Top"
                                                  Template="{StaticResource CloseButtonTemplate}"
                                                  Width="18" Height="18" 
                                                  FontWeight="Bold"
                                                  Foreground="#FF222222"
                                                  >x</Button>

                </Grid>

                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>


                    <StackPanel>
                        <Image 
                            Width="64" Height="64" Margin="5" 
                            HorizontalAlignment="Left"
                            Source="{Binding Path=IconUri}"
                            
                            MouseLeftButtonDown="OpenUri"
                            Cursor="Hand">
                            <Image.BitmapEffect>
                                <DropShadowBitmapEffect Softness=".5" ShadowDepth="3" Color="Gray"/>
                            </Image.BitmapEffect>
                            <Image.ContextMenu>
                                <ContextMenu>
                                    <MenuItem Header="URLをコピー" Click="MenuItem_Click"  />
                                </ContextMenu>
                            </Image.ContextMenu>
                        </Image>
                    </StackPanel>

                    <Grid Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="24" />
                        </Grid.RowDefinitions>
                        <TextBlock  TextWrapping="Wrap" Foreground="#333" 
                           Text="{Binding Path=Content}"
                           Margin="0 0 5 0"
                           ScrollViewer.VerticalScrollBarVisibility="Auto" />
                        <Grid Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="60" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <TextBlock Padding="1" Margin="5 0 0 0"  Foreground="#333" Text="{Binding Path=FooterLeft}" VerticalAlignment="Center" />
                            <StackPanel Margin="0 0 5 0" 
                                        Orientation="Horizontal" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" >
                                <TextBlock Padding="1" Foreground="#333" Text="{Binding Path=FooterRight}" VerticalAlignment="Center" />
                            </StackPanel>
                        </Grid>

                    </Grid>
                </Grid>
            </Grid>
        </Border>
    </Border>

    <!--<Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="24" />
            <RowDefinition />
            <RowDefinition Height="24" />
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="23" />
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0">
                <Image Margin="5 0 0 0" Grid.Column="1" HorizontalAlignment="Right" Source="../Icons/notify.ico" Stretch="None" Width="16" Height="16" />
                <TextBlock 
                    Margin="5 0 0 0"
                    Text="{Binding Path=Title}" VerticalAlignment="Center">
                    <TextBlock.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="URLをコピー" Click="MenuItem_Click"  />
                        </ContextMenu>
                    </TextBlock.ContextMenu>
                </TextBlock>
            </StackPanel>
            <Image Grid.Column="1" HorizontalAlignment="Right" Margin="0 0 5 0"
                   Source="../Images/closeButton.png" Stretch="None" Width="15" Height="15" VerticalAlignment="Center"
                   Cursor="Hand"
                   MouseDown="CloseButton_Click"/>
        </Grid>

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="110" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
          

            <StackPanel>
                <Image 
                    Width="96" Height="96" Margin="5" 
                    HorizontalAlignment="Left"
                    Source="{Binding Path=Icon}"
                    Cursor="Hand">
                    <Image.BitmapEffect>
                        <DropShadowBitmapEffect Softness=".5" ShadowDepth="5" Color="Black"/>
                    </Image.BitmapEffect>
                    <Image.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="URLをコピー" Click="MenuItem_Click"  />
                        </ContextMenu>
                    </Image.ContextMenu>
                </Image>
            </StackPanel>
             
                               
            <TextBlock Grid.Column="1" TextWrapping="Wrap" Foreground="#333" 
                       Text="{Binding Path=Content}"
                       Margin="0 0 5 0"
                       ScrollViewer.VerticalScrollBarVisibility="Auto" />
             
        </Grid>
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <TextBlock Padding="1" Margin="5 0 0 0"  Foreground="#333" Text="{Binding Path=FooterLeft}" VerticalAlignment="Center" />
            <StackPanel  Margin="0 0 5 0" 
                Orientation="Horizontal" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" >
                <TextBlock Padding="1" Foreground="#333" Text="{Binding Path=FooterRight}" VerticalAlignment="Center" />
            </StackPanel>
        </Grid>
    </Grid>-->

</Window>
